package com.face.server.convert;

import com.face.server.entity.Student;
import com.face.server.vo.NormStu;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by ryan on 2018/3/12.
 */
public class Student2NormStu {
    public static NormStu convert(Student student){
        NormStu stu= new NormStu();
        BeanUtils.copyProperties(student,stu);
        return stu;
    }

    public static List<NormStu> convert(List<Student> students){
        return students.stream().map(e->convert(e)).collect(Collectors.toList());
    }
}
